Optimal. Leaf size=80 \[ \frac {a^2 (e x)^n}{e n}-\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac {b^2 x^{-n} (e x)^n \cot \left (c+d x^n\right )}{d e n} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4209, 4205, 3773, 3770, 3767, 8} \[ \frac {a^2 (e x)^n}{e n}-\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac {b^2 x^{-n} (e x)^n \cot \left (c+d x^n\right )}{d e n} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 3773
Rule 4205
Rule 4209
Rubi steps
\begin {align*} \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx &=\frac {\left (x^{-n} (e x)^n\right ) \int x^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx}{e}\\ &=\frac {\left (x^{-n} (e x)^n\right ) \operatorname {Subst}\left (\int (a+b \csc (c+d x))^2 \, dx,x,x^n\right )}{e n}\\ &=\frac {a^2 (e x)^n}{e n}+\frac {\left (2 a b x^{-n} (e x)^n\right ) \operatorname {Subst}\left (\int \csc (c+d x) \, dx,x,x^n\right )}{e n}+\frac {\left (b^2 x^{-n} (e x)^n\right ) \operatorname {Subst}\left (\int \csc ^2(c+d x) \, dx,x,x^n\right )}{e n}\\ &=\frac {a^2 (e x)^n}{e n}-\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac {\left (b^2 x^{-n} (e x)^n\right ) \operatorname {Subst}\left (\int 1 \, dx,x,\cot \left (c+d x^n\right )\right )}{d e n}\\ &=\frac {a^2 (e x)^n}{e n}-\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\cos \left (c+d x^n\right )\right )}{d e n}-\frac {b^2 x^{-n} (e x)^n \cot \left (c+d x^n\right )}{d e n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.70, size = 102, normalized size = 1.28 \[ \frac {x^{-n} (e x)^n \left (2 a \left (a c+a d x^n+2 b \log \left (\sin \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )-2 b \log \left (\cos \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )\right )+b^2 \tan \left (\frac {1}{2} \left (c+d x^n\right )\right )+b^2 \left (-\cot \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )\right )}{2 d e n} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.50, size = 116, normalized size = 1.45 \[ \frac {a^{2} d e^{n - 1} x^{n} \sin \left (d x^{n} + c\right ) - a b e^{n - 1} \log \left (\frac {1}{2} \, \cos \left (d x^{n} + c\right ) + \frac {1}{2}\right ) \sin \left (d x^{n} + c\right ) + a b e^{n - 1} \log \left (-\frac {1}{2} \, \cos \left (d x^{n} + c\right ) + \frac {1}{2}\right ) \sin \left (d x^{n} + c\right ) - b^{2} e^{n - 1} \cos \left (d x^{n} + c\right )}{d n \sin \left (d x^{n} + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \csc \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{n - 1}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 2.25, size = 275, normalized size = 3.44 \[ \frac {a^{2} x \,{\mathrm e}^{\frac {\left (-1+n \right ) \left (-i \pi \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )+i \pi \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )^{2}+i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )^{2}-i \pi \mathrm {csgn}\left (i e x \right )^{3}+2 \ln \relax (x )+2 \ln \relax (e )\right )}{2}}}{n}-\frac {2 i x \,{\mathrm e}^{\frac {\left (-1+n \right ) \left (-i \pi \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )+i \pi \,\mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )^{2}+i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )^{2}-i \pi \mathrm {csgn}\left (i e x \right )^{3}+2 \ln \relax (x )+2 \ln \relax (e )\right )}{2}} b^{2} x^{-n}}{d n \left ({\mathrm e}^{2 i \left (c +d \,x^{n}\right )}-1\right )}-\frac {4 \arctanh \left ({\mathrm e}^{i \left (c +d \,x^{n}\right )}\right ) e^{n} a b \,{\mathrm e}^{\frac {i \pi \,\mathrm {csgn}\left (i e x \right ) \left (-1+n \right ) \left (\mathrm {csgn}\left (i e x \right )-\mathrm {csgn}\left (i x \right )\right ) \left (-\mathrm {csgn}\left (i e x \right )+\mathrm {csgn}\left (i e \right )\right )}{2}}}{d e n} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.25, size = 207, normalized size = 2.59 \[ -\frac {2 \, b^{2} e^{n} \sin \left (2 \, d x^{n} + 2 \, c\right )}{d e n \cos \left (2 \, d x^{n} + 2 \, c\right )^{2} + d e n \sin \left (2 \, d x^{n} + 2 \, c\right )^{2} - 2 \, d e n \cos \left (2 \, d x^{n} + 2 \, c\right ) + d e n} + \frac {\left (e x\right )^{n} a^{2}}{e n} - \frac {{\left (e^{n} \log \left (\cos \left (d x^{n}\right )^{2} + 2 \, \cos \left (d x^{n}\right ) \cos \relax (c) + \cos \relax (c)^{2} + \sin \left (d x^{n}\right )^{2} - 2 \, \sin \left (d x^{n}\right ) \sin \relax (c) + \sin \relax (c)^{2}\right ) - e^{n} \log \left (\cos \left (d x^{n}\right )^{2} - 2 \, \cos \left (d x^{n}\right ) \cos \relax (c) + \cos \relax (c)^{2} + \sin \left (d x^{n}\right )^{2} + 2 \, \sin \left (d x^{n}\right ) \sin \relax (c) + \sin \relax (c)^{2}\right )\right )} a b}{d e n} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.17, size = 182, normalized size = 2.28 \[ \frac {a^2\,x\,{\left (e\,x\right )}^{n-1}}{n}-\frac {b^2\,x\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}}{d\,n\,x^n\,\left ({\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x^n\,2{}\mathrm {i}}-1\right )}-\frac {2\,a\,b\,x\,\ln \left (-a\,b\,{\left (e\,x\right )}^{n-1}\,4{}\mathrm {i}-a\,b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\,4{}\mathrm {i}\right )\,{\left (e\,x\right )}^{n-1}}{d\,n\,x^n}+\frac {2\,a\,b\,x\,\ln \left (a\,b\,{\left (e\,x\right )}^{n-1}\,4{}\mathrm {i}-a\,b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\,4{}\mathrm {i}\right )\,{\left (e\,x\right )}^{n-1}}{d\,n\,x^n} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (e x\right )^{n - 1} \left (a + b \csc {\left (c + d x^{n} \right )}\right )^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________